<?php
namespace socket;

class Gravatar
{
	/**
	 * 通过邮箱来获取头像地址
	 * @param unknown $email
	 * @param number $s
	 * @param string $d
	 * @param string $r
	 * @param string $img
	 * @param array $atts
	 * @return string
	 */
	public static function getGravatar( $email, $s = 96, $d = 'mp', $r = 'g', $img = false, $atts = array() ) {
		$url = 'https://www.gravatar.com/avatar/';
		$url .= md5( strtolower( trim( $email ) ) );
		$url .= "?s=$s&d=$d&r=$r";
		return $url;
	}
}
